Optimal. Leaf size=144 \[ \frac{a^2 (4 A+5 B) \tan (c+d x)}{3 d}+\frac{a^2 (7 A+8 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a^2 (5 A+4 B) \tan (c+d x) \sec ^2(c+d x)}{12 d}+\frac{a^2 (7 A+8 B) \tan (c+d x) \sec (c+d x)}{8 d}+\frac{A \tan (c+d x) \sec ^3(c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.30362, antiderivative size = 144, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.258, Rules used = {2975, 2968, 3021, 2748, 3768, 3770, 3767, 8} \[ \frac{a^2 (4 A+5 B) \tan (c+d x)}{3 d}+\frac{a^2 (7 A+8 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a^2 (5 A+4 B) \tan (c+d x) \sec ^2(c+d x)}{12 d}+\frac{a^2 (7 A+8 B) \tan (c+d x) \sec (c+d x)}{8 d}+\frac{A \tan (c+d x) \sec ^3(c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2975
Rule 2968
Rule 3021
Rule 2748
Rule 3768
Rule 3770
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int (a+a \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^5(c+d x) \, dx &=\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{4} \int (a+a \cos (c+d x)) (a (5 A+4 B)+2 a (A+2 B) \cos (c+d x)) \sec ^4(c+d x) \, dx\\ &=\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{4} \int \left (a^2 (5 A+4 B)+\left (2 a^2 (A+2 B)+a^2 (5 A+4 B)\right ) \cos (c+d x)+2 a^2 (A+2 B) \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx\\ &=\frac{a^2 (5 A+4 B) \sec ^2(c+d x) \tan (c+d x)}{12 d}+\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{12} \int \left (3 a^2 (7 A+8 B)+4 a^2 (4 A+5 B) \cos (c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac{a^2 (5 A+4 B) \sec ^2(c+d x) \tan (c+d x)}{12 d}+\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{3} \left (a^2 (4 A+5 B)\right ) \int \sec ^2(c+d x) \, dx+\frac{1}{4} \left (a^2 (7 A+8 B)\right ) \int \sec ^3(c+d x) \, dx\\ &=\frac{a^2 (7 A+8 B) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (5 A+4 B) \sec ^2(c+d x) \tan (c+d x)}{12 d}+\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{8} \left (a^2 (7 A+8 B)\right ) \int \sec (c+d x) \, dx-\frac{\left (a^2 (4 A+5 B)\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac{a^2 (7 A+8 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a^2 (4 A+5 B) \tan (c+d x)}{3 d}+\frac{a^2 (7 A+8 B) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (5 A+4 B) \sec ^2(c+d x) \tan (c+d x)}{12 d}+\frac{A \left (a^2+a^2 \cos (c+d x)\right ) \sec ^3(c+d x) \tan (c+d x)}{4 d}\\ \end{align*}
Mathematica [A] time = 1.13358, size = 262, normalized size = 1.82 \[ -\frac{a^2 (\cos (c+d x)+1)^2 \sec ^4\left (\frac{1}{2} (c+d x)\right ) \sec ^4(c+d x) \left (24 (7 A+8 B) \cos ^4(c+d x) \left (\log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )\right )-\sec (c) (-24 (4 A+5 B) \sin (c)+3 (15 A+8 B) \sin (d x)+45 A \sin (2 c+d x)+128 A \sin (c+2 d x)+21 A \sin (2 c+3 d x)+21 A \sin (4 c+3 d x)+32 A \sin (3 c+4 d x)+24 B \sin (2 c+d x)+136 B \sin (c+2 d x)-24 B \sin (3 c+2 d x)+24 B \sin (2 c+3 d x)+24 B \sin (4 c+3 d x)+40 B \sin (3 c+4 d x))\right )}{768 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.115, size = 187, normalized size = 1.3 \begin{align*}{\frac{7\,{a}^{2}A\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{7\,{a}^{2}A\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{5\,B{a}^{2}\tan \left ( dx+c \right ) }{3\,d}}+{\frac{4\,{a}^{2}A\tan \left ( dx+c \right ) }{3\,d}}+{\frac{2\,{a}^{2}A \left ( \sec \left ( dx+c \right ) \right ) ^{2}\tan \left ( dx+c \right ) }{3\,d}}+{\frac{B{a}^{2}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{d}}+{\frac{B{a}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}A \left ( \sec \left ( dx+c \right ) \right ) ^{3}\tan \left ( dx+c \right ) }{4\,d}}+{\frac{B{a}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.02096, size = 311, normalized size = 2.16 \begin{align*} \frac{32 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{2} + 16 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} - 3 \, A a^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A a^{2}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 24 \, B a^{2}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, B a^{2} \tan \left (d x + c\right )}{48 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.48132, size = 362, normalized size = 2.51 \begin{align*} \frac{3 \,{\left (7 \, A + 8 \, B\right )} a^{2} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (7 \, A + 8 \, B\right )} a^{2} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (8 \,{\left (4 \, A + 5 \, B\right )} a^{2} \cos \left (d x + c\right )^{3} + 3 \,{\left (7 \, A + 8 \, B\right )} a^{2} \cos \left (d x + c\right )^{2} + 8 \,{\left (2 \, A + B\right )} a^{2} \cos \left (d x + c\right ) + 6 \, A a^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.24173, size = 286, normalized size = 1.99 \begin{align*} \frac{3 \,{\left (7 \, A a^{2} + 8 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - 3 \,{\left (7 \, A a^{2} + 8 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (21 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} + 24 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} - 77 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 88 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 83 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 136 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 75 \, A a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 72 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]